//
//  UserGudieViewController.m
//  MingShi
//
//  Created by MJiao on 15/7/7.
//  Copyright (c) 2015年 MJiao. All rights reserved.
//

#import "UserGudieViewController.h"

@interface UserGudieViewController ()

@end

@implementation UserGudieViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    CGRect ScreenRect = [[UIScreen mainScreen] bounds];
    UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, ScreenRect.size.width, ScreenRect.size.height)];
    [self.view addSubview:scrollView];

    for (int i = 0; i<3; i++) {
        NSString *string = [NSString stringWithFormat:@"userGuide0%i.png",i+1];
        UIImage *forImage = [UIImage imageNamed:string];
        UIImageView *ForImageView = [[UIImageView alloc]initWithImage:forImage];
        ForImageView.frame = CGRectMake(ScreenRect.size.width*i, 0, ScreenRect.size.width, ScreenRect.size.height);
        [scrollView addSubview:ForImageView];
    }
    //设置滚动视图的内容的大小
    scrollView.contentSize = CGSizeMake(ScreenRect.size.width*6, 0);
    //设置分页
    scrollView.pagingEnabled = YES;

    //再最后一页上 设置一个button
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(100 +ScreenRect.size.width*5, 370, 120, 50);
    [button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
    //button.backgroundColor = [UIColor cyanColor];

    [scrollView addSubview:button];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
